# 计算1到100的和
a = 1
sum = 0
while a <= 100:
    sum += a
    a += 1

print(sum)

# 嵌套while循环,以找座位为例子
ticketX = 9
ticketY = 3
x = 0
y = 0
while y <= 20:
    while x <= 20:
        if x == ticketX:
            break
        else:
            x += 1
    if y == ticketY:
        print(f"找到座位啦~,x={x},y={y}")
        break
    else:
        y += 1